import request from '@/utils/request'

// 查询客户案件列表
export function listBankCustomerCases(query) {
  return request({
    url: '/system/cases/list',
    method: 'get',
    params: query
  })
}

// 查询客户案件详细
export function getBankCustomerCases(caseId) {
  return request({
    url: '/system/cases/' + caseId,
    method: 'get'
  })
}

// 新增客户案件
export function addBankCustomerCases(data) {
  return request({
    url: '/system/cases',
    method: 'post',
    data: data
  })
}

// 修改客户案件
export function updateBankCustomerCases(data) {
  return request({
    url: '/system/cases',
    method: 'put',
    data: data
  })
}

// 删除客户案件
export function delBankCustomerCases(caseId) {
  return request({
    url: '/system/cases/' + caseId,
    method: 'delete'
  })
}

// 导出客户案件
export function exportBankCustomerCases(query) {
  return request({
    url: '/system/cases/export',
    method: 'get',
    params: query
  })
}

// 上传文件
export function uploadFile(data) {
  return request({
    url: '/system/cases/upload',
    method: 'post',
    data: data
  })
}

// 下载文件
export function downloadFile(fileName) {
  return request({
    url: '/system/cases/download-file',
    method: 'get',
    params: { fileName: fileName },
    responseType: 'blob'
  })
}

// 分配客户
export function assignCases(data) {
  return request({
    url: '/system/cases/assign',
    method: 'put',
    data: data
  })
}

// 更新客户公海池信息
export function updateCasesPool(data) {
  return request({
    url: '/system/cases/pool',
    method: 'put',
    data: data
  })
}

// 更新关联人信息
export function updateContactPersons(data) {
  return request({
    url: '/system/cases/contact-persons',
    method: 'put',
    data: data
  })
}

// 删除关联人信息
export function deleteContactPerson(data) {
  return request({
    url: '/system/cases/delete-contact-person',
    method: 'put',
    data: data
  })
}
